//
//  ViewController.m
//  协议
//
//  Created by clz on 2019/7/21.
//  Copyright © 2019年 clz. All rights reserved.
//

#import "ViewController.h"
#import "Man.h"
#import "Dog.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    Man *man = [[Man alloc]init];
//    [man eat];
    
    Dog *dog = [[Dog alloc]init];
//    [dog eat];
    
    //协议是协议  代理是代理
    man.delegate = dog;//dog 成为了man的代理
    
    if ([man.delegate respondsToSelector:@selector(watch)]) {
        [man.delegate watch];
    }
    
    
    
}


@end
